//
//  NewFautureViewController.swift
//  weibo2
//
//  Created by xuwzh on 15/10/7.
//  Copyright © 2015年 xuwzh. All rights reserved.
//

import UIKit


class NewFautureViewController: UICollectionViewController {

    
    
    @IBOutlet weak var layout: UICollectionViewFlowLayout!
    
    override func viewDidLoad() {
        super.viewDidLoad()

      
    }

    
    let imageCount=4
    override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        // #warning Incomplete implementation, return the number of items
        return imageCount
    }

    override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCellWithReuseIdentifier("NewFeature", forIndexPath: indexPath) as! NewFeatureCell
        
    
        cell.imageIndex=indexPath.item
    
        return cell
    }
    

   
}

class NewFeatureCell : UICollectionViewCell{
    
    
    @IBOutlet weak var iconImage: UIImageView!
    @IBOutlet weak var startButton: UIButton!
    @IBAction func clickButton() {
    }
    
    var imageIndex:Int = 0{
        didSet {
          iconImage.image=UIImage(named: "new_feature_\(imageIndex+1)")
        }
    }
    
}
